package edu.byu.intex2.data.bo;

import edu.byu.intex2.data.DataException;
import edu.byu.intex2.data.dao.SalespersonDAO;

/**
 * Salesperson sales cars.
 * @author Brady
 */
public class Salesperson extends Employee{
    private double commissionPercent;

    /** Creates a new instance of BusinessObject */
    public Salesperson(String id) {
        super(id);
    }//constructor

    /** Convenience method to call the correct DAO to save this business object */
    @Override
    public void save() throws DataException {
        try {
            SalespersonDAO.getInstance().save(this);
        } catch (DataException e) {
            e.printStackTrace();
        }
    }
    /**
     * @return the commissionPercent
     */
    public double getCommissionPercent() {
        return commissionPercent;
    }

    /**
     * @param commissionPercent the commissionPercent to set
     */
    public void setCommissionPercent(double commissionPercent) {
        this.commissionPercent = commissionPercent;
        setDirty(true);
    }
    
}
